UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '673n9OMuXLpBVCpc796GaksNWif0SyjqzCVkKQY3eLY='
WHERE
key_id = '8fa40239f71666cb90c811ddb98d0b36ed5e33429e023cf2f1219f3380f1a688'
AND (
token = '673n9OMuXLpBVCpc796GaksNWif0SyjqzCVkKQY3eLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)