UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xCIOYUPOxItCWbCVwevXHfuG04pDkN0b0RODCf2rqzw='
WHERE
key_id = 'abdd9caaaedceb5d593895d7a00b45dfa3f2796c5cba5bc04b258190111ece11'
AND (
token = 'xCIOYUPOxItCWbCVwevXHfuG04pDkN0b0RODCf2rqzw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)