UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7SDhyuw1EERI4DRotq8EnXklZM/Tn7YRCz93HbeknIE='
WHERE
key_id = '675ae1dda8e875719bfcd084afd5df63e47a1a588d5d702abade9a1e3863b4d2'
AND (
token = '7SDhyuw1EERI4DRotq8EnXklZM/Tn7YRCz93HbeknIE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)