UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5GUyGjNwNZ5OCGBnsMbtIVq5IQ1JstgMGrLxUeZqxbU='
WHERE
key_id = 'cfb4c2cb9abc318b6bed808671492a9356aa9cc025af853414196013087da3f3'
AND (
token = '5GUyGjNwNZ5OCGBnsMbtIVq5IQ1JstgMGrLxUeZqxbU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)