UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eE6cyt93akbea7FuWxnyMJYtFNklmJ4QvJ5kSitsoDc='
WHERE
key_id = '61be016243883a836653f9385453ed47b4d89d6d933086a155100dddd4ab01c0'
AND (
token = 'eE6cyt93akbea7FuWxnyMJYtFNklmJ4QvJ5kSitsoDc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)