UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OehQQyIKG5HIDiC6pk/lodhagdaa2CMXoGSKOycq8DI='
WHERE
key_id = '74266a1f300dc07868d8892a5563e2db2c701edadf3a0ee954c74f01f68c6426'
AND (
token = 'OehQQyIKG5HIDiC6pk/lodhagdaa2CMXoGSKOycq8DI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)