UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BoX1+FEFfWfiTeehU8Vv4fz33Q54Dl4wIaysaGR8d0M='
WHERE
key_id = '84144e71c408680187625c8f6c84e6f912110f560eb0768691aa1ae07c91a91b'
AND (
token = 'BoX1+FEFfWfiTeehU8Vv4fz33Q54Dl4wIaysaGR8d0M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)