UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rO8/KiBvxnw5ZuRMLS4P+yNOlct7oS9E7K7pCCSluRE=' 
WHERE 
  key_id = '01964b4d8814fc56610e1cc002056d9b427b82a98f68124be36e3c326b19f122' 
  AND (
    token = 'rO8/KiBvxnw5ZuRMLS4P+yNOlct7oS9E7K7pCCSluRE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032