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

Query time 0.00048