UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NkiOfeHsAiOnjnshXZfhebC5If8hFxrdKnb2KAtZzHw='
WHERE
key_id = '5d58b4dea147ba8b72da8d4ada6ee53886b0ec7f6ba209ae3a745cc1d27ab7b0'
AND (
token = 'NkiOfeHsAiOnjnshXZfhebC5If8hFxrdKnb2KAtZzHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)