UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LT2AZFlXDBr45uazbMYbF+39FHB0BDUPl1SPE0ZJO94='
WHERE
key_id = '72b1c59274b9da76691a735e1abae73f9e8bc289a80c996604993a57fa864f1e'
AND (
token = 'LT2AZFlXDBr45uazbMYbF+39FHB0BDUPl1SPE0ZJO94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)