UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9ilpi0DDElxvU/PJzNZxXS+ZRdytwePE5hKif2ICzCQ=' 
WHERE 
  key_id = '9d9057e73a60fb41d508425218a59698643ff33aaa4275bc13c27826aa259453' 
  AND (
    token = '9ilpi0DDElxvU/PJzNZxXS+ZRdytwePE5hKif2ICzCQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027