UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WaRcEcDn7GRjOjX9YjiuF9CWPPQxqcxOdZxz00zwd9E=' 
WHERE 
  key_id = '3c1967b4257b05aa4ce62b92129ce6ade5b7642fc2df637301dcca717ed70ab1' 
  AND (
    token = 'WaRcEcDn7GRjOjX9YjiuF9CWPPQxqcxOdZxz00zwd9E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014