UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ufkukfr4vDuhe1EhyIu4vqnZx3c8wCmxBkknk4HCpVM='
WHERE
key_id = '681f38ead91175762d1a9b43845090684d69bf0086317bc4d702c2dcb1bda798'
AND (
token = 'Ufkukfr4vDuhe1EhyIu4vqnZx3c8wCmxBkknk4HCpVM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)