UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VbY+Ic0ndVIEuNNPc2jTy89TrmbpoPL0Madrpk4cOyI=' 
WHERE 
  key_id = 'feea3b09ebbbf048e3b22202e04edd28ba239942d49ff3448c5746c5688d546d' 
  AND (
    token = 'VbY+Ic0ndVIEuNNPc2jTy89TrmbpoPL0Madrpk4cOyI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031