UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MKEt5s6BMmB4BE3UN98caRakhlvxxOEylFjZGBjsXgk='
WHERE
key_id = '33d906c6cb8d6c50c92762cb500f5db14d94a75268d088206b0606725375fcc3'
AND (
token = 'MKEt5s6BMmB4BE3UN98caRakhlvxxOEylFjZGBjsXgk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)