UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2ENLeZ+qTvgqIgqjWP/SbWawC9iLQdxf69WNHtoIp04='
WHERE
key_id = '462e7f5a28cca5ef9e6cda2d5fcb89925540f0469e453ff9717eb3c2630638bd'
AND (
token = '2ENLeZ+qTvgqIgqjWP/SbWawC9iLQdxf69WNHtoIp04='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)