UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sjHfgOmSxcSfptfU3Sb0uXPJCRxkRDRpDr3OE9vPPxs=' 
WHERE 
  key_id = '0a5a29b753ccdb8d4fe041db18fc9635ea7f67cb56fad03dfc8ab5a3961e06ca' 
  AND (
    token = 'sjHfgOmSxcSfptfU3Sb0uXPJCRxkRDRpDr3OE9vPPxs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023