UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tLqEF4Bb/BDKOVLdMMj5NQ/VSoucYT+Xn/2p/7E9sAQ='
WHERE
key_id = '58e555d8c49fd3fa2e4be14e87819e55bad90d0defb95e9a242640ed21eab0d3'
AND (
token = 'tLqEF4Bb/BDKOVLdMMj5NQ/VSoucYT+Xn/2p/7E9sAQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)