UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xQ3wLR3dOw4DTGzsOFAWuxfgXCHt1COrUCAbrreuNQY='
WHERE
key_id = '419412a72c8b692690360f2688fb0055a6347e711c8200fe953048afd271398c'
AND (
token = 'xQ3wLR3dOw4DTGzsOFAWuxfgXCHt1COrUCAbrreuNQY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)