UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KrlYG0oDBkAARP7HfE55i9MK5VV2akUZhhVhrxtYHtk='
WHERE
key_id = '88224031cac215366a104a5d4cc074e5152c1c862cf3cde6ad4433067d0683fb'
AND (
token = 'KrlYG0oDBkAARP7HfE55i9MK5VV2akUZhhVhrxtYHtk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)