UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p7/Vn6Qd6lXJfFWvMTN/cORDvrkf5Dor72Mfl45t6RU=' 
WHERE 
  key_id = 'f3ae61cf572ae00912a179b497bd1ea3f614b8e2e1a63f433ef54a3712fdc209' 
  AND (
    token = 'p7/Vn6Qd6lXJfFWvMTN/cORDvrkf5Dor72Mfl45t6RU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027