UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K17g/OSPLw55vX30e3p2uzjnnZeTsei0xUZzEhmGKyc=' 
WHERE 
  key_id = 'b43e0ebd83d4b355cc63257c2e1829dee20fb2f7ea47dc00b6a9250477c351c4' 
  AND (
    token = 'K17g/OSPLw55vX30e3p2uzjnnZeTsei0xUZzEhmGKyc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028