UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DgXRox6/YrGj0S4cf3m1unUHjT6K9EyUACREXbT/vl8='
WHERE
key_id = '6b5e3eb11e37cb0e73604238c592f9d5a86f7a7241a84bfc273e62eeb2515220'
AND (
token = 'DgXRox6/YrGj0S4cf3m1unUHjT6K9EyUACREXbT/vl8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)