UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FQodpnRLipNC0fH18Kvh8VPK7w+w86B2qX4I6ihDh5M='
WHERE
key_id = '306ce613c8f9eb69a13027fc24fb66bf9894a9ebed69c265187b7c924466aeb3'
AND (
token = 'FQodpnRLipNC0fH18Kvh8VPK7w+w86B2qX4I6ihDh5M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)