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