UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E5yu4qiIYYLh9JN8g7RrnOMp3vfy/BtkaVGwD83gHhA='
WHERE
key_id = '2e7b712b3323582288827c96ce9f4db0fb5a8de367d5aaa2061c1a643f287e1f'
AND (
token = 'E5yu4qiIYYLh9JN8g7RrnOMp3vfy/BtkaVGwD83gHhA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)