UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5Fp0HLwDKQUnVuw/iewgaNHo6aKtJhH1H80r8VSuOAI=' 
WHERE 
  key_id = '6f8de39312b20140c18eba9cbea71ab1e3936a7e7cd38a8ce4f8959fa57c02e7' 
  AND (
    token = '5Fp0HLwDKQUnVuw/iewgaNHo6aKtJhH1H80r8VSuOAI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032