UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'faAGJFzgATIWQy/j/kcLn/LTMi+913FKkwV8df9ZXEI='
WHERE
key_id = '2ce4c75027f04fef90f79a528d6dd296da3fbf004320a67494fe2e04b9a70eb3'
AND (
token = 'faAGJFzgATIWQy/j/kcLn/LTMi+913FKkwV8df9ZXEI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)