UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GAhFfjilQZsPQyO6LHmr39Lld35mT0aSFNVoF+dKDG4='
WHERE
key_id = 'fb3e69b282903c368e86d079587298f860eecddfd3985a1b5dd4ad32bcabb59f'
AND (
token = 'GAhFfjilQZsPQyO6LHmr39Lld35mT0aSFNVoF+dKDG4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)