UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JanlNUD9sonqNE4zPvO3yzPr3UEP3CAQ5oikTphqrFc='
WHERE
key_id = 'a600eb4af4b11456108eb61284767458f5a840bc7617dfb0a43c780e7863f561'
AND (
token = 'JanlNUD9sonqNE4zPvO3yzPr3UEP3CAQ5oikTphqrFc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)