UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GuIZHQNlg8/QIVgmc/2HN9ll3kODDsCScjOlkdu9Zg4='
WHERE
key_id = 'fd9ecfae14e9828b3037a10905834709a6172da99234e014a724dd9339a2a29b'
AND (
token = 'GuIZHQNlg8/QIVgmc/2HN9ll3kODDsCScjOlkdu9Zg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)