UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Sya3sU8wB5/1oKJFYfAmpypdSMP9EBfYLYXOkkfkHI='
WHERE
key_id = '2ff5eb053eab8926c4ef5ca1c55d9ac0eeb05fb4ce31f8f0856ccd87ca6307d5'
AND (
token = '9Sya3sU8wB5/1oKJFYfAmpypdSMP9EBfYLYXOkkfkHI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)