UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yZcl3ZL3iVQZvo3Z/DafbnsoKe8+hjw8Pk8py4btYTU=' 
WHERE 
  key_id = '00880e05351531fb1a6c1c4fdbcb5868e384f0b742f481a09f48efc0a758a399' 
  AND (
    token = 'yZcl3ZL3iVQZvo3Z/DafbnsoKe8+hjw8Pk8py4btYTU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045