UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WwbLpK8B0+UE7BBN1VT1TEOdFl+HgEAtY4x7khtVyXI=' 
WHERE 
  key_id = 'e206d931a1bd0caebba85b14719118dabc075b03026df7484cd6e179e4f4deb1' 
  AND (
    token = 'WwbLpK8B0+UE7BBN1VT1TEOdFl+HgEAtY4x7khtVyXI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035